import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router)

export default new Router({
  mode: 'history',
  routes:[
    {
      path: '/index',
      name: 'Index',
      component: () => import('@/views/Index'),
      redirect: '/top',
      children:[
        {
          path: '/top',
          name: 'Top',
          component: () => import('@/views/Top'),
        },{
          path: '/video',
          name: 'Video',
          component: () => import('@/views/Video'),
        },{
          path: '/happy',
          name: 'Happy',
          component: () => import('@/views/Happy'),
        },{
          path: '/fashion',
          name: 'Fashion',
          component: () => import('@/views/Fashion'),
        },{
          path: '/society',
          name: 'Society',
          component: () => import('@/views/Society'),
        },{
          path: '/select',
          name: 'Select',
          component: () => import('@/views/Select'),
        }
      ]
    },{
      path: '/',
      redirect:'/index',
    },{
      path: '/toAdmin',
      name: 'Login',
      component: () => import('@/views/admin/Login')
    },{
      path: '/admin',
      name: 'Admin',
      component: () => import('@/views/admin/Admin'),
      children:[
        {
          path: '/user',
          name: 'User',
          component: () => import('@/views/admin/UserAdmin'),
        },
        {
          path: '/role',
          name: 'Role',
          component: () => import('@/views/admin/RoleAdmin'),
        },
        {
          path: '/infor',
          name: 'Infor',
          component: () => import('@/views/admin/InforAdmin'),
        },
        {
          path: '/classify',
          name: 'Classify',
          component: () => import('@/views/admin/ClassifyAdmin'),
        }
      ]
    }
  ]

})
